home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / CLESSONS.ZIP / EXPLAIN < prev    next >
Text File  |  1986-03-22  |  17KB  |  540 lines

  1. .T
  2.     a DISPLAY program for text files    
  3. .R6C1
  4.     ~V                                                                     ~N
  5.     ~V If you have comments, criticisms, suggestions, etc. concerning this ~N
  6.     ~V               display program, please write to:                     ~N
  7.     ~V                                                                     ~N
  8. .b5-10
  9. .R12C3
  10. .B
  11. P.J.Ponzo
  12. .B
  13. Dept. of Applied Math
  14. .B
  15. University of Waterloo, Ontario N2L 3G1
  16. .K17,30
  17. PonzoTUTOR
  18. .WN
  19.                                ~IPLEASE NOTE~N:
  20. ~I~W
  21. .B
  22. ~r          The DISPLAY program requires the ANSI.SYS device driver.          ~N
  23.  
  24.  
  25.  
  26.    Be sure that there is a ~Iconfig.sys~N file on the disk, which contains:
  27.                         
  28.    ~Idevice = ansi.sys~N
  29. ~I~W
  30. .B
  31. ~r            and the IBM PC is turned on WITH THE DISK INSERTED!             ~N
  32.  
  33. .R16C1
  34.     You may create such a ~Iconfig.sys~N by typing:
  35.  
  36.  ~IA>copy con:config.sys~N
  37.  ~Idevice=ansi.sys~N
  38.   (now press F6 then Enter)
  39.  
  40.    This will place the appropriate ~Iconfig.sys~N on your disk (which must
  41.    also have a copy of the DOS ~Iansi.sys~N device driver)
  42. .b15-24
  43. .WNT
  44.   How to use the DISPLAY program  
  45.  
  46.     The program ~Idisplay~N is meant to be used in place of the DOS ~Itype~N 
  47.     command. To ~Idisplay~N a file called sam, just type: ~IA>display sam~N 
  48.  
  49.     The features of ~Idisplay~N which make it different from ~Itype~N are: 
  50.  
  51. 1)  After each screen, the ~Idisplay~N will wait for you to press a key.  
  52.  
  53. 2)  If certain 'special commands' appear  in  the  file  to be ~Idisplay~Ned, this
  54.     will cause the ~Idisplay~N to give colours (foreground and/or background),
  55.     position the 'next line' at any specified row or column, clear the screen,
  56.     cause the ~Idisplay~N to pause until a key is pressed or print  the  'next
  57.     line' as a 'title' (centred, in intense white, surrounded by red bars).
  58.     You see an example of a 'title' line at the top of this  screen.  (Indeed,
  59.     ~Ithis~N explanation of ~Idisplay~N uses these features!)
  60.  
  61. Now we will describe these 'special commands':
  62. .WNT
  63.  The DOT COMMANDS 
  64.     Certain DOT COMMANDS are available. They must appear on a line of their
  65.     own, beginning with a DOT in the first column, followed immediately by:
  66.     ~b~IT~N, ~b~IR~N, ~b~IC~N, ~b~IW~N, ~b~Iw~N, ~b~IN~N, ~b~IQ~N, ~b~IB~N , etc.
  67.     
  68.  
  69.                  ~b~I           The DOT COMMAND .T                ~N
  70.  
  71.  
  72.     If a line of a file to be ~Idisplay~Ned begins ~b~I.T~N, it causes
  73.     ~Idisplay~N to print the 'next line' as a title, for example:
  74.  
  75. ~b~I.T~N
  76. ~b~IChapter One~N
  77.  
  78.     will cause 'Chapter One' to be ~Idisplay~Ned as a title:
  79.  
  80. .T
  81. Chapter One
  82. .WN
  83.                 ~b~I        The DOT COMMANDS .R and .C             ~N
  84.  
  85.  
  86.  
  87.     If a line of a file to be ~Idisplay~Ned begins ~b~I.R15~N, it will cause
  88.     the cursor to move to ~b~IR~Now ~b~I15~N.
  89.  
  90.     If a line of a file to be ~Idisplay~Ned begins ~b~I.C33~N, it will cause
  91.     the cursor to move to ~b~IC~Nolumn ~b~I33~N.
  92.  
  93. ~b~I.R20~N                               go to row 20.
  94. ~b~I.T~N                                 prepare for title.
  95. ~b~I I'm a title on row 20 ~N            this is the title.
  96.  
  97. .R20
  98. .T
  99.  I'm a title on row 20 
  100. .WN
  101.                ~b~I   More on   DOT COMMANDS .R and .C            ~N
  102.  
  103.  
  104.  
  105.     The sequence of DOT commands:
  106.  
  107. ~b~I.R20~N
  108. ~b~I.C33~N
  109. ~b~II'm on row 20, starting at column 33~N
  110.  
  111.     will print (at row 20, column 33):
  112. .R20C33
  113. I'm on row 20, starting at column 33
  114. .WN
  115.             ~b~I         The DOT COMMANDS .W  .N  and  .q           ~N
  116.  
  117.  
  118. ~b~I.W~N      will cause the message ~BPlease press the Enter key...(q=quit)~N
  119.               to appear at the bottom of the screen and further ~Idisplay~N
  120.               of the text file is suspended until a key is pressed.
  121.               (You will recognize this message at the bottom of ~Ithis~N
  122.               screen).  ~b~IW~N means ~b~IW~Nait.
  123.  
  124. ~b~I.N~N      will give you a ~b~IN~New screen (~b~I.N~N clears the screen).
  125.  
  126.  
  127. ~b~I.q~N      will ~b~Iq~Nuit the ~Idisplay~N and return to DOS.
  128. .WN
  129.                ~b~I         The DOT COMMAND   .B                 ~N
  130.  
  131.  
  132. ~b~I.B~N      will cause the NEXT LINE to be printed in a 'box'.
  133.                                                                 
  134.               ~INOTE~N:You might use ~b~I.R~N and ~b~I.C~N to place the cursor
  135.                    at the appropriate place on the screen before you use
  136.                    the ~b~I.B~N command. The ~b~IR~Now and ~b~IC~Nolumn will
  137.                    define the top left corner of the box.
  138.               After using ~b~I.B~N, ~Ithe cursor is at the top right of~N
  139.               ~Ithe box~N. For example:
  140. ~b~I.R20~N
  141. ~b~I.C10~N
  142. ~b~I.B~N
  143. ~b~I    Jack-in-a-box    ~N   will give:
  144. .R20C10
  145. .B
  146.     Jack-in-a-box    
  147. .R19C10
  148. ~I~Nrow 20,col 10 is here.
  149. .R20C34
  150. ~I█~N cursor is left here (ready for another box!)
  151. .WN
  152.  
  153. ~b~I.R20~N                             
  154. ~b~I.C10~N                             
  155. ~b~I.B~N                               What will the combination of
  156. ~b~Ifirst~N                            .commands (shown at left) do?
  157. ~b~I.B~N
  158. ~b~Isecond~N
  159. .W
  160. .R18C10
  161. .B
  162. first
  163. .B
  164. second
  165. .WN
  166.                ~b~I         The DOT COMMAND   .b                 ~N
  167.  
  168. ~b~I.b10-18~N        will put a screen-wide box, from row ~I10~N to row ~I18~N.
  169. .W
  170. .b10-18
  171. .W
  172. .R14C15
  173. ~V  ...and, of course, you can now put text inside....~N
  174. .WNR10C2
  175.     ... or you can have a se~Ix~Ny box:
  176.  
  177.  
  178. ~b~I.x9-12~N
  179. .Wx9-12
  180. .WNT
  181.     Another   DOT command   .Q   
  182. ~b~I.Q~N                                  Will ask the following question:
  183. ~b~IWho was buried in Grant's tomb?~N
  184. ~b~IGrant~N                               ...and expect ~Ithis~N answer.
  185.  
  186.     (You may use ~b~I.Q13~N to first place the cursor on row ~b~I13~N)
  187.  
  188.     Let's try it out on ~IYOU~N!
  189. .K19,60
  190. !@#$%^&*!!
  191. .WN
  192.  
  193. .Q
  194. Who was buried in Grant's tomb?
  195. Grant
  196. .K19,60
  197. cock who?
  198. .Q
  199. Who killed cock robin?
  200. I can't remember either!
  201. .K19,60
  202.   FOUR!
  203. .Q
  204. 2+2=
  205. 4
  206. .K19,60
  207. dumb!dumb!
  208. .WNT
  209.     The DOT COMMANDS  .s  and  .r   
  210.  
  211.     When you use ~b~I.W~N (to ~b~IW~Nait) or ~b~I.K~N (the ~b~IK~Nartoon, explained shortly) the
  212.     cursor position is ~Isaved~N, the DOT COMMAND does its stuff, then the
  213.     cursor is ~Irestored~N.
  214.  
  215.     When you use ~b~I.B~N (to ~b~IB~Nox the following line of text) the cursor
  216.     is left "suspended", ready for another ~b~I.B~Nox. If you don't want another
  217.     "boxed-text", move the cursor with ~b~I.R~N and ~b~I.C~N.
  218.  
  219.     In order to facilitate moving around the screen, printing here and there,
  220.     there are two more DOT COMMANDS.
  221.  
  222. ~b~I.s~N         the ~b~Is~N will ~b~Is~Nave the current cursor position...
  223. ~b~I.R10C2~N     now move to another ~b~IR~Now and ~b~IC~Nolumn...
  224. ~b~Isome text~N  print something..
  225. ~b~I.r~N         ~b~Ir~Nestore the ~b~Is~Naved cursor position.
  226. .WNT
  227.     the Komputer Kartoon    
  228.    
  229.     ...and, for Komic relief, you also have a Komputer Kartoon:
  230.  
  231.     Just include the dot command:
  232.  
  233. ~b~I.K15,33~N            gives a Kartoon at row 15, column 33.
  234. ~b~Imamma mia!~N         comment (by the Kartoon) ~Iwith 10 characters or less!~N
  235.  
  236.     ...and you get:
  237. .W
  238. .K15,33
  239. mamma mia!
  240. .WNT
  241.  REVIEW of DOT COMMANDS 
  242. .R5C1
  243. ~b~I.T~N      the 'next line' is printed as a ~b~IT~Nitle.
  244. ~b~I.R12~N    moves to  ~b~IR~Now ~b~I12~N.
  245. ~b~I.C22~N    moves to  ~b~IC~Nolumn ~b~I22~N.
  246. ~b~I.W~N      ~b~IW~Naits for a key-press (automatic, after 22 lines).
  247. ~b~I.w~N      sets (above) line count to zero (discussed later).               
  248. ~b~I.N~N      gives a ~b~IN~New (clear) screen.
  249. ~b~I.q~N      will ~b~Iq~Nuit (returning to DOS).
  250. ~b~I.B~N      will print the 'next line' in a box (with ~Isuspended cursor!~N).
  251. ~b~I.b5-13~N  will draw a screen-wide ~Ib~Nox from line ~b~I5~N to line ~b~I13~N.
  252. ~b~I.x5-13~N  will draw a screen-wide se~Ix~Ny box (line ~b~I5~N to line ~b~I13~N).
  253. ~b~I.Q~N      will ask ~b~IQ~Nuestion (on the following line) and expect the
  254.         answer (on the line following that).
  255. ~b~I.s~N      will ~b~Is~Nave the current cursor position.
  256. ~b~I.r~N      will ~b~Ir~Nestore the (saved) cursor position.
  257. ~b~I.K19,60~N will print a ~b~IK~Nomputer ~b~IK~Nartoon at row ~b~I19~N and
  258.         column ~b~I60~N, with the ~b~IK~Nomment on the 'next line'.
  259. .WNT
  260. A final note about the DOT COMMANDS:
  261.  
  262.     Because the ~b~IR~Now and ~b~IC~Nolumn specifications are often used
  263.     together, these DOT commands may be on the SAME LINE.
  264.  
  265. ~b~I.R20C30~N      moves to ~b~IR~Now ~b~I20~N and ~b~IC~Nolumn ~b~I30~N.
  266.  
  267.     In fact, most of the DOT COMMANDS will work when strung out
  268.     on one line, after the initial DOT in column 1:
  269.  
  270. ~b~I.WNT~N    will ~b~IW~Nait, then provide a~b~IN~New screen, then a ~b~IT~Nitle.
  271.  
  272. ~b~I.R10C1B~N  will go to ~b~IR~Now ~b~I10~N, ~b~IC~Nolumn ~b~I1~N and get ready for a ~b~IB~Nox.
  273.  
  274.     Not all DOT COMMANDS may be strung out on one line. The ~b~I.T~Nitle, ~b~I.B~Nox,
  275.     ~b~I.b~Nox and ~b~I.K~Nartoon want desperately to print something on the screen.
  276.     SO, ~Iafter these, everything on a DOT COMMAND line is ignored!~N
  277.  
  278. ~b~I.WNb5-7R10~N   will ~b~IW~Nait, ~b~IN~New screen, give a ~b~Ib~Nox from row
  279.              ~b~I5~N to ~b~I7~N, .... and ~Iignore~N ~b~IR10~N!
  280. .WNT
  281.   ...and yet another DOT COMMAND   
  282.       If you ~Idisplay~N an ASCII text file which is NOT especially written
  283.     with the 'special commands'...in particular, if there are no ~b~I.W~N
  284.     ~b~IW~Nait commands...then ~Idisplay~N will read 22 lines of text and
  285.     then will ~b~IW~Nait for the Enter key. ~IThe display program counts
  286.     the number of lines which are read from the text file and ~N~b~IW~N~Iaits
  287.     after 22 lines are read.~N However, in some cases, you may have a file
  288.     written with the 'special' ~Idisplay~N DOT COMMANDS which (of course)
  289.     are NOT printed on the screen but are instructions to the ~Idisplay~N
  290.     program. In this case, the text file may have 20 lines of text (which
  291.     are meant to be printed on the screen) and 5 DOT COMMANDS (each on its
  292.     own line!). That makes 25 lines from your text file of which 20 are
  293.     to be printed. Too bad !! ~Idisplay~N will ~b~IW~Nait after 22 lines are
  294.     read from the file. What you want is to have ~Idisplay~N read ALL 25
  295.     lines, and print the 20 which are NOT DOT COMMANDS, before ~b~IW~Naiting.
  296.     To achieve this you must tell ~Idisplay~N to set the line count back to 
  297.     zero. There is another DOT COMMAND for this:
  298. .WN
  299.  
  300.  
  301.  
  302.  
  303. ~b~I.w~N      will set the line count to zero, and ~Idisplay~N will begin
  304.               counting lines from this point. A ~b~IW~Nait will occur after
  305.               the ~Rnext~N 22 lines (unless there is another ~b~I.w~N command)
  306.               or until a ~b~I.W~N command occurs).
  307.  
  308.  
  309.  
  310. .WNT
  311.   The TILDE COMMANDS  
  312.     Whereas the DOT COMMANDS must have a line to themselves (beginning with
  313.     the DOT), there are  COLOUR  COMMANDS which may be embedded in the text
  314.     itself. Each time a TILDE appears in the text file, the  NEXT CHARACTER
  315.     has a special meaning for ~Idisplay~N.
  316.  
  317. ~b~IThe quick brown fox jumped over the lazy log.~N
  318.  
  319.     The above piece of text will appear 'NORMAL' (white on black).
  320.     If you wish the word 'fox' to be in RED, precede it with ~b~I~~R~N.
  321.     After the ~b~I~~R~N, ALL subsequent text will be in RED!
  322.     To change to NORMAL text, insert ~b~I~~N~N. Hence the above line of
  323.     text would be rewritten as:
  324.  
  325. ~b~IThe quick brown ~~Rfox~~N jumped over the lazy log.~N
  326.  
  327.     and would be ~Idisplay~Ned as:
  328.  
  329. The quick brown ~Rfox~N jumped over the lazy log.
  330. .WN
  331.                   ~b~I           All the colours           ~N
  332.  
  333.     Here are all the COLOUR COMMANDS for ~RTEXT~N:
  334.  
  335. ~b~I~~R~N     changes text to ~b~IR~Ned.............~Rthis is red~N
  336. ~b~I~~Y~N     changes text to ~b~IY~Nellow..........~Ythis is yellow~N
  337. ~b~I~~G~N     changes text to ~b~IG~Nreen...........~Gthis is green~N
  338. ~b~I~~B~N     changes text to ~b~IB~Nlue............~Bthis is blue~N
  339. ~b~I~~C~N     changes text to ~b~IC~Nyan............~Cthis is cyan~N
  340. ~b~I~~M~N     changes text to ~b~IM~Nagenta.........~Mthis is magenta~N
  341. ~b~I~~W~N     changes text to ~b~IW~Nhite...........~Wthis is white~N
  342.     and 
  343. ~b~I~~I~N     changes text to ~b~II~Nntense.........~Ithis is intense~N
  344. ~b~I~~F~N     changes text to ~b~IF~Nlash...........~Fthis is flash~N
  345. ~b~I~~V~N     changes text to re~b~IV~Nerse video...~Vthis is reverse video~N
  346. ~b~I~~N~N     changes text to ~b~IN~Normal again....~Nthis is normal~N
  347.  
  348.     Guess what the following line of text will ~Idisplay~N:
  349.  
  350. ~b~I~~F~~Rr~~Ya~~Gi~~Bn~~Cb~~Mo~~Ww~N
  351. .W
  352. .R21C30
  353. ~F~Rr~Ya~Gi~Bn~Cb~Mo~Ww~N
  354. .WN
  355.  
  356.                     ~b~I          Coloured Background          ~N
  357.  
  358.     In addition to embedding ~b~I~~R~N (to change to ~b~IR~Ned text), you
  359.     may change the background colour to ~b~Ir~Ned by inserting ~b~I~~r~N
  360.     in your text file.
  361.  
  362. ~b~I~~r~N     changes background to ~b~Ir~Ned.......~rthis is red~N
  363. ~b~I~~y~N     changes background to ~b~Iy~Nellow....~ythis is yellow~N
  364. ~b~I~~g~N     changes background to ~b~Ig~Nreen.....~gthis is green~N
  365. ~b~I~~b~N     changes background to ~b~Ib~Nlue......~bthis is blue~N
  366. ~b~I~~g~N     changes background to ~b~Ic~Nyan......~cthis is cyan~N
  367. ~b~I~~m~N     changes background to ~b~Im~Nagenta...~mthis is magenta~N
  368. ~b~I~~w~N     changes background to ~b~Iw~Nhite.....~V             ~N
  369.                                        (can ~Iyou~N see white-on-white?~N)
  370.     REMEMBER: ~b~I~~N~N returns (again) to ~b~IN~Normal white on black.
  371.  
  372.     Guess what the following line of text will ~Idisplay~N:
  373. .R20C1
  374. ~b~I~~w~~I~~MThis is a test~~N~N
  375. .W
  376. .R20C1
  377. ~V~~w~N~b~I~~I~~MThis is a test~~N~N
  378. .R22C1
  379.     This gives a ~b~Iw~Nhite background.              
  380. .W
  381. .R20C1
  382. ~b~I~~w~V~~I~~M~N~b~IThis is a test~~N~N
  383. .R22C1
  384.     This gives  ~b~II~Nntense ~b~IM~Nagenta text.
  385. .W
  386. .R20C1
  387. ~b~I~~w~~I~~M~VThis is a test~N~b~I~~N~N
  388. .R22C1
  389.     This prints some text ( 'This is a test' ).                          
  390. .W
  391. .R20C1
  392. ~b~I~~w~~I~~MThis is a test~V~~N~N
  393. .R22C1
  394.     This returns to ~b~IN~Normal text.                                  
  395. .W
  396. .R20C1
  397. ~b~I~~w~~I~~MThis is a test~~N~N
  398. .R22C1
  399.     ...and the ~Idisplay~Ned result will be intense-magenta-on-white:        
  400. .W
  401. .R20C30
  402. ~w~I~MThis is a test~N
  403. .WN
  404.  
  405.     ...and you can have ~Icolour-in-a-box~N....
  406.  
  407.  
  408. ~b~I~~I~~G~N                          intense green box.
  409. ~b~I.B~N                            here comes the box...
  410. ~b~I~~w~~Rred-on-white text~~N~N   and the stuff in the box.
  411.  
  412. ~I~G
  413. .B
  414. ~w~Rred-on-white text~N
  415. .W
  416. .R15C10
  417. ~V
  418. .B
  419. ~N~I...or reverse video maybe ? ~N     (~Iyou~N figure this one out!)
  420. .WN
  421.  
  422.  
  423.  
  424.              ~b~I       ...and how to print a TILDE on the screen?     ~N
  425.  
  426.  
  427.     ...just embed ~b~I~~~~~N in your text, and the TWO TILDES generate
  428.     a TILDE in your text!
  429.  
  430.  
  431.     One other point: for a ~Imonochrome monitor~N, choosing ~b~I~~B~N (to get
  432.     blue text) will give ~w~Bunderlined~N characters~I!!
  433.  
  434.  
  435.  
  436. .WNR5C2
  437.  ... and you may change the (entire) background colour ...
  438.  
  439. To get a screen full of ~Ib~Nlue background, just include:
  440.  
  441. ~b~I~~b~N
  442.  
  443.  then ~Iclear the screen~N with:
  444.  
  445. ~b~I.N~N
  446.  
  447.  then begin each line of your text with ~b~I~~b~N  
  448.  
  449.  (to get blue background in the text too!)
  450. .W
  451. ~b
  452. .N
  453. .R5C1
  454. ~b ... ain't this nice (just start your text with ~~b)
  455. .R8C2
  456. ~b~I~W ... or maybe "intense white on blue" text (using ~~b~~I~~W)
  457. .W
  458. ~b~I~Y
  459. .x4-6 
  460. ~b~I~G
  461. .x7-9
  462. ~b~I~R
  463. .x10-12
  464. ~b~I~Y
  465. .R11C2
  466. ~b~I ... and sexy coloured boxes (using ~~b~~I~~Y then .x4-6  etc.)
  467. .W
  468. ~b~I~W
  469. .K16,32
  470. lovely!
  471. .WN
  472.  
  473. .T
  474.    MEMORY DISPLAY  
  475.  
  476.  
  477.     When you type  ~Idisplay memory~N the display program will look on the
  478.     disk for a file called ~Vmemory~N. If there is such a file, it will load
  479.     and ~Idisplay~N the file.
  480.  
  481.     If, however, there is no such file on disk then ~Idisplay~N will ask
  482.     for ~VSEGMENT~N and ~VOFFSET~N and will display the contents of the ~IIBM~N
  483.     ~IPC~N MEMORY.
  484.  
  485.     During the ~Idisplay~N, you may modify the contents of memory.
  486.  
  487.     ( ...try SEGMENT ~Ib800~N and OFFSET ~I0~N to see ~Vscreen memory~N.)
  488. .WN
  489. .R2C32
  490. ~r~I~Gas ~N
  491. .R2C32
  492. ~r~I~Gmas ~N
  493. .R2C32
  494. ~r~I~Gtmas ~N
  495. .R2C32
  496. ~r~I~Gstmas ~N
  497. .R2C32
  498. ~r~I~Gistmas ~N
  499. .R2C32
  500. ~r~I~Gristmas ~N
  501. .R2C32
  502. ~r~I~Ghristmas ~N
  503. .R2C32
  504. ~r~I~GChristmas ~N
  505. .R2C32
  506. ~r~I~G Christmas ~N
  507. .R2C32
  508. ~r~I~Gy Christmas ~N
  509. .R2C32
  510. ~r~I~Gry Christmas ~N
  511. .R2C32
  512. ~r~I~Grry Christmas ~N
  513. .R2C32
  514. ~r~I~Gerry Christmas ~N
  515. .R2C32
  516. ~r~I~GMerry Christmas ~N
  517. .R2C32
  518. ~r~I~G Merry Christmas ~N
  519. .R1C32
  520. ~r~I~G                 ~N
  521. .R3C32
  522. ~r~I~G      1985       ~N
  523. .wT
  524.   That's all folks!  
  525.  
  526.  
  527.  
  528. P.S.
  529.  
  530.     If you want to see an example of the use of ~Idisplay~N, just ~Itype~N
  531.     this ~Iexplain~N file (which has all the 'special commands' in it).
  532.     (Unlike ~Idisplay~N, the DOS ~Itype~N will not interpret the 'special'
  533.     commands, and you'll be able to see them all).
  534.  
  535. ~IA>type explain~N
  536.  
  537.  
  538. .q
  539.  
  540.